#include <jni.h>
#include <syslog.h>
#include <cpu-features.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>

#ifndef let
#define let     __auto_type
#endif

extern int MyASMTest(int a, int b);
extern int MyASMSub(int a, int b);

JNIEXPORT jstring JNICALL
Java_com_example_kotlintest_MainActivity_stringFromJNI(JNIEnv* env, jobject object)
{
    let const value = 100;
    const char *s = "Hello from C";
    syslog(LOG_INFO, "The value is: %d\n", value);
    return (*env)->NewStringUTF(env, s);
}

JNIEXPORT void JNICALL
Java_com_example_kotlintest_MainActivityKt_packageMethod(JNIEnv *env, jclass clazz, jint i)
{
    // TODO: implement packageMethod()
    let const value = MyASMTest(5, 3) + MyASMSub(10, 7);
    syslog(LOG_INFO, "(5 - 3) + (10 - 7) = %d\n", value);
}
